/**
 * 
 */
package org.tangram.web;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author han_feng
 * 
 */
public class DelegatingListener implements ServletContextAttributeListener,
		ServletContextListener, ServletRequestListener,
		ServletRequestAttributeListener, HttpSessionListener,
		HttpSessionAttributeListener {

	private static final Logger logger = LoggerFactory
			.getLogger(DelegatingListener.class);

	public void attributeAdded(HttpSessionBindingEvent event) {
		logger.debug("session.attributeAdded( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	/**
	 * @see javax.servlet.ServletContextAttributeListener#attributeAdded(javax.servlet.ServletContextAttributeEvent)
	 */
	public void attributeAdded(ServletContextAttributeEvent event) {
		logger.debug("application.attributeAdded( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	/**
	 * @see javax.servlet.ServletRequestAttributeListener#attributeAdded(javax.servlet.ServletRequestAttributeEvent)
	 */
	public void attributeAdded(ServletRequestAttributeEvent event) {
		logger.debug("request.attributeAdded( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	public void attributeRemoved(HttpSessionBindingEvent event) {
		logger.debug("session.attributeRemoved( \"{}\" )", event.getName());
	}

	/**
	 * @see javax.servlet.ServletContextAttributeListener#attributeRemoved(javax.servlet.ServletContextAttributeEvent)
	 */
	public void attributeRemoved(ServletContextAttributeEvent event) {
		logger.debug("application.attributeRemoved( \"{}\" )", event.getName());
	}

	/**
	 * @see javax.servlet.ServletRequestAttributeListener#attributeRemoved(javax.servlet.ServletRequestAttributeEvent)
	 */
	public void attributeRemoved(ServletRequestAttributeEvent event) {
		logger.debug("request.attributeRemoved( \"{}\" )", event.getName());
	}

	public void attributeReplaced(HttpSessionBindingEvent event) {
		logger.debug("session.attributeReplaced( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	/**
	 * @see javax.servlet.ServletContextAttributeListener#attributeReplaced(javax.servlet.ServletContextAttributeEvent)
	 */
	public void attributeReplaced(ServletContextAttributeEvent event) {
		logger.debug("application.attributeReplaced( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	/**
	 * @see javax.servlet.ServletRequestAttributeListener#attributeReplaced(javax.servlet.ServletRequestAttributeEvent)
	 */
	public void attributeReplaced(ServletRequestAttributeEvent event) {
		logger.debug("request.attributeReplaced( \"{}\" , \"{}\" )",
				event.getName(), event.getValue());
	}

	/**
	 * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
	 */
	public void contextDestroyed(ServletContextEvent event) {
		logger.debug("contextDestroyed");
	}

	/**
	 * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
	 */
	public void contextInitialized(ServletContextEvent event) {
		logger.debug("contextInitialized");
	}

	/**
	 * @see javax.servlet.ServletRequestListener#requestDestroyed(javax.servlet.ServletRequestEvent)
	 */
	public void requestDestroyed(ServletRequestEvent event) {
		logger.debug("requestDestroyed");
	}

	/**
	 * @see javax.servlet.ServletRequestListener#requestInitialized(javax.servlet.ServletRequestEvent)
	 */
	public void requestInitialized(ServletRequestEvent event) {
		logger.debug("requestInitialized");
	}

	public void sessionCreated(HttpSessionEvent event) {
		logger.debug("sessionCreated");
	}

	public void sessionDestroyed(HttpSessionEvent event) {
		logger.debug("sessionDestroyed");
	}

}
